package com.power.structure.heap;

/**
 * @description:
 * @author: jiangnan
 * @time: 2021/6/15 10:10 上午
 */
public class PriorityQueue {

    int data[];
    int CAPACITY = 10;
    int size = 0;

    public PriorityQueue() {
        data = new int[10];
    }
    //父节点索引
    public int parent(int index) {
        return (index - 1) / 2;
    }
    //左孩子索引
    public int leftChild(int index) {
        return index * 2 + 1;
    }
    //右孩子索引
    public int rightChild(int index) {
        return index * 2 + 2;
    }

}
